﻿namespace Typps.Tests
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Text;
    using System.Text.RegularExpressions;

    public static class Helper
    {
        #region Methods

        public static Stream GetResourceByName(Type t, string resourcePath)
        {
            return t.Assembly.GetManifestResourceStream(resourcePath);
        }

        /// <summary>
        /// Testing html with formatting and whitespace is not practical. what we want to test is if the markup is the same!
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        public static string TrimAllWhiteSpace(string text)
        {
            //Remove spaces and comments
            return Regex.Replace(text, @"\s+", string.Empty);
        }

        #endregion Methods
    }
}